import request from '@/utils/request'

const TRAINER_API_PREFIX = '/admin/trainer'

export default {
  getTrainerPage(params) {
    return request({
      url: TRAINER_API_PREFIX + '/page',
      method: 'get',
      params
    })
  },
  deleteBatchTrainer(ids) {
    return request({
      url: TRAINER_API_PREFIX + '/batch',
      method: 'delete',
      data: ids
    })
  },
  deleteTrainer(id) {
    return request({
      url: TRAINER_API_PREFIX + '/' + id,
      method: 'delete'
    })
  },
  saveTrainer(data) {
    return request({
      url: TRAINER_API_PREFIX,
      method: 'post',
      data
    })
  },
  getTrainerById(id) {
    return request({
      url: TRAINER_API_PREFIX + '/' + id,
      method: 'get'
    })
  },
  updateById(id, data) {
    return request({
      url: TRAINER_API_PREFIX + '/' + id,
      method: 'put',
      data
    })
  },
  IdentifyEmpById(id, isIdentify) {
    return request({
      url: `${TRAINER_API_PREFIX}/${id}/${isIdentify}`,
      method: 'put'
    })
  },
  getAllTrainer() {
    return request({
      url: TRAINER_API_PREFIX + '/all',
      method: 'get'
    })
  },
}
